#ifndef _BSP_DRIVER_H_
#define _BSP_DRIVER_H_

#include "main.h"

//#define RGBWY
// API Struct
struct driver_interface_t
{
	int (*get)(unsigned char *,int);
	int (*set)(unsigned char *,int);
	int (*init)(void);
	int (*status)(unsigned char *,int);
	int (*read)(unsigned char *,int);
	int (*write)(unsigned char *,int);
	void (*handler)(void *);
};
//	work_sta
#define STATUS_OFF			0
#define STATUS_WORK			1
#define STATUS_CHAR_ONLE	2
//
typedef struct{
	uint16_t work_sta:2;
	uint16_t char_sta:1;	
	uint16_t init_sta:1;
	uint16_t show_sta:2;	//
	uint16_t test_sta:2;
	uint16_t pwm_sta:1;
	uint16_t adc_sta:1;	
	uint16_t select_sta:3;	
	uint16_t b11_sta:1;	
	uint16_t low_power:1;	
	uint16_t flag_full:1;	
}T_status_t;
typedef struct
{
	uint8_t bat_lev;
	uint8_t bat_lev_show;
	uint8_t mode_sum;
	uint8_t	ff;
	uint16_t show_k;
	uint16_t rgb_h;
	uint8_t rgb_s;
	uint8_t sence;
	uint8_t light_sum;
	uint8_t flag_val;
	uint8_t rgb_val;
	T_status_t status;
	float f_bat_val;
}T_device_t;
extern T_device_t device_t;
// API
void driver_init(void);
void driver_handler(void);

#endif

















